From 7e3e50729f43dc5625f2ae874450b96fa347a106 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Tue, 19 Nov 2013 12:36:12 -0500 Subject: [PATCH] wayland: Fix invalid cast in transient_for --- gdk/wayland/gdkwindow-wayland.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c index e81cad89ef..08e20af09d 100644 --- a/gdk/wayland/gdkwindow-wayland.c +++ b/gdk/wayland/gdkwindow-wayland.c @@ -839,16 +839,25 @@ static void gdk_wayland_window_sync_transient_for (GdkWindow *window) { GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); - GdkWindowImplWayland *impl_parent = GDK_WINDOW_IMPL_WAYLAND (impl->transient_for); + struct wl_surface *transient_for_surface; if (!impl->xdg_surface) return; - /* XXX: Is this correct? */ - if (!impl_parent->surface) - return; + if (impl->transient_for) + { + GdkWindowImplWayland *impl_parent = GDK_WINDOW_IMPL_WAYLAND (impl->transient_for->impl); + + /* XXX: Is this correct? */ + if (!impl_parent->surface) + return; + + transient_for_surface = impl_parent->surface; + } + else + transient_for_surface = NULL; - xdg_surface_set_transient_for (impl->xdg_surface, impl_parent->surface); + xdg_surface_set_transient_for (impl->xdg_surface, transient_for_surface); } static void -- 2.30.2